<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="/WEB-INF/template/basicTemplate.xhtml">
	<ui:define name="jsLinks">
		<h:outputScript target="head" library="js" name="countdown.js"></h:outputScript>
	</ui:define>
	<ui:define name="content">
		<h:inputHidden rendered="#{menuController.userRank != 2}" value="#{menuController.redirect()}"></h:inputHidden>
		<h:inputHidden value="#{menuController.setUrl(request.requestURL)}"></h:inputHidden>
		<h:inputHidden rendered="#{menuController.userRank == 2}">
		<h:outputText id="countdown" name="countdown"></h:outputText>
		<f:verbatim>
			<script type="text/javascript">
				countdown(#{questionController.nrOfMinutes});
			</script>
		</f:verbatim>
		<h:form>
			<h:commandLink value="Back to current question"
				action="#{questionController.goToQuestions}"
				rendered="#{questionController.theEnd}">
			</h:commandLink>
	 		&nbsp;&nbsp;&nbsp;
			<br></br>
			&nbsp;&nbsp;&nbsp;
			<h:panelGrid columns="1" rendered="#{questionController.haveMarked}">
				<h:dataTable id="table" value="#{questionController.marked}"
					var="int" border="10" binding="#{questionController.dataTable}">
					<h:column>
						<f:facet name="header">
							<h:outputText value="Marked question" />
						</f:facet>
						<h:outputText value="#{int}" />
					</h:column>
					<h:column>
						<h:commandButton styleClass="button" value="GO"
							action="#{questionController.getMarkedQuestion}">
						</h:commandButton>
					</h:column>
				</h:dataTable>
			</h:panelGrid>
			<h:commandButton styleClass="button" value="Finish" action="#{questionController.finishTest}"/>
			<h:outputText value="You have no marked questions."
				rendered="#{questionController.dontHaveMarked}">
			</h:outputText>
		</h:form>
		</h:inputHidden>
	</ui:define>
</ui:composition>
</html>